package com.ruoyi.sensitiveword;

import java.util.*;

// 定义Trie树的节点
class TrieNode {
    private Map<Character, TrieNode> children = new HashMap<>();
    private boolean isEnd;

    public void addChild(Character c) {
        children.putIfAbsent(c, new TrieNode());
    }

    public TrieNode getChild(Character c) {
        return children.get(c);
    }

    public boolean isEnd() {
        return isEnd;
    }

    public void setEnd(boolean end) {
        isEnd = end;
    }
}
